@include media-breakpoint-up(sm) {
  #site-navigation {
    width: 100%;
    position: relative;
    display: block;
    background-color: $menubg;

    &.main-navigation {

      ul {
        padding: 0;
        margin: 0;
        list-style: none;
      }

      .menu {
        display: flex;
        flex: 1 0 auto;
        justify-content: space-between;
        flex-wrap: nowrap;
        align-items: stretch;
        align-content: stretch;

        li {
          position: relative;

          li {
            border-bottom: 1px solid rgba($black, .03);

            &:last-child {
              border-bottom: none;
            }
          }

          &:hover {
            > ul {
              display: block;
              visibility: visible;
              opacity: 1;
              top: 100%;

              ul {
                top: 0;
              }
            }
          }

          a {
            display: block;
            padding: $grid-gutter-width /2 $grid-gutter-width /2;
            color: $menufontcolor;

            &:hover {
              background-color: $menufonthoverbgcolor;
              color: lighten($menufonthovercolor, 80%);
              //box-shadow: 0 3px 3px rgba(black, .2);
            }
          }
        }

        > li {
          flex: auto;
          align-items: center;
          justify-content: center;
          height: $menubuttonsize;

          a {
            text-align: center;
            height: 100%;
            vertical-align: middle;
            justify-content: center;
            align-items: center;
            display: flex;
            font-size: $menufontsize;
            font-weight: 700;
            //text-shadow: 0px 0px 3px rgba(0, 0, 0, .6);

            small {
              display: block;
              text-align: center;
              font-size: 60%;
              font-weight: lighter;
              color: #c1c2c3;

            }

            &:hover {
              color: $menufonthovercolor;
            }
          }

          > a {
            flex-direction: column;
            line-height: 1.6;
            font-size: 1.2rem;
          }

          > ul {
            padding-top: 15px;

            &::before {
              content: "";
              border-style: solid;
              border-width: 0 9px 9px 9px;
              border-color: transparent transparent $submenubg transparent;
              height: 0;
              position: absolute;
              left: 15px;
              top: 6px;
              width: 0;
              -webkit-transform: rotate(360deg);
            }


          }

          ul {
            //padding: $grid-gutter-width /2 0;
            position: absolute;
            left: 0;
            top: 80%;
            z-index: 9999;
            min-width: 300px;
            max-width: 500px;
            width: 100%;
            //display:none;
            opacity: 0;
            visibility: hidden;
            -webkit-transition: all .35s ease-in-out, visibility .35s ease-in-out;
            transition: all .35s ease-in-out, visibility .35s ease-in-out;

            &::after {
              content: "";
              position: absolute;
              width: 100%;
              background: $submenubg;
              top: 0;
              left: 0;
              bottom: 0;
              margin-top: 15px;
              z-index: -1;
              border-radius: $menubuttonradius;
              @include box_shadow(1px 1px 10px rgba(black, .2));
            }

            li {
              //background-color: $menubg;
              padding: 3px;
              //box-shadow: 1px 1px 5px rgba($black, .2);

              &:first-child {
                border-top-left-radius: $menubuttonradius;
                border-top-right-radius: $menubuttonradius;

                > a {
                  border-top-left-radius: $menubuttonradius;
                  border-top-right-radius: $menubuttonradius;
                }
              }

              &:last-child {
                border-bottom-right-radius: $menubuttonradius;
                border-bottom-left-radius: $menubuttonradius;

                > a {
                  border-bottom-right-radius: $menubuttonradius;
                  border-bottom-left-radius: $menubuttonradius;
                }
              }

              ul {
                left: 100%;
                top: 0;

                &::after {
                  top: -15px;
                }
              }

              a {
                justify-content: flex-start;
                font-weight: normal;
                color: $submenulinkcolor;
                padding: $submenupadding;

                &:hover {
                  color: $submenuhovercolor;
                  background: $submenuhoverbgcolor;
                }
              }
            }
          }

          /* li ul */
        }

      }
    }
  }
}


@include media-breakpoint-down(sm) {
  body {
    font-size: 1rem;
  }
  #site-navigation {
    position: absolute;
    background: transparent;
    z-index: 999;

    &.main-navigation {
      .menu {
        display: none;
        position: relative;
        width: 100%;
        background: $primary;
        border-radius: 15px;
        padding-top: 15px;
        padding-bottom: 15px;
        list-style: none;
        padding-left: 1rem;
        padding-right: 3rem;
        overflow-y: auto;
        max-height: 500px;

        > li {
          padding-left: $grid-gutter-width /2;
          padding-right: $grid-gutter-width /2;

          &::before {
            content: "\2022";
            color: $white;
            font-weight: bold;
            display: inline-block;
            width: 1em;
            margin-left: -1em;
          }

          a {
            color: $white;

            &:hover {
              color: $warning;
            }
          }

          ul {
            background: rgba(darken($primary, 10%), 0);
            position: relative;
            opacity: 1;
            visibility: visible;
            box-shadow: none;
            border-radius: 15px;
            padding-top: 15px;
            padding-bottom: 15px;
            list-style: none;

            li {
              ul {
                left: 0;
              }
            }
          }
        }
      }

      &.toggled {
        ul.menu {
          display: block;
        }
      }
    }


  }
}

.page-navigation {
  text-align: center;
  padding: 40px 0;
}

.pagination {
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #eee;

  .page_button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 40px;
  }

  .prev, .next, .dots {
    @extend .page_button;
    padding-left: 10px;
    padding-right: 10px;
  }

  .prev {
    border-right: 1px solid #eee;
  }

  .prev, .next {
    &:hover {
      background-color: $primary;
      color: $body-bg;
    }
  }

  .page-numbers {
    border-right: 1px solid #eee;

    &:last-child {
      border-right: 0;
    }

    .page-item {
      @extend .page_button;

      &:hover {
        background-color: $primary;
        color: $body-bg;
      }
    }

    .page-item {
      width: 40px;
    }
  }
}


.post-navigation {
  .nav-links {
    border-top: 5px solid $gray-200;
    /* Android */
    display: -webkit-box;
    -webkit-box-pack: justify;

    /* iOS */
    display: -webkit-flex;
    -webkit-justify-content: space-between;

    /* IE10 */
    display: -ms-flexbox;
    -ms-flex-pack: justify;

    /* w3c */
    display: flex;
    justify-content: space-between;


    &::before, &::after {
      display: none;
    }

    .nav-previous, .nav-next {
      isplay: -webkit-box;
      -webkit-box-orient: vertical;

      a {
        display: block;
        padding: 5px 15px;
        margin: 20px 0;
        //border: 1px solid #f7f7f7;
        //background: $primary;
        //color: $white;
        //border-radius: 15px;

        &:hover {
          //background: $secondary;
        }
      }
    }

    .nav-previous {
      a {
        &::before {
          margin-right: 5px;
          content: "\f104";
          font-family: 'Font Awesome\ 5 Free';
          font-weight: 900;
        }
      }
    }

    .nav-next {
      a {
        &::after {
          margin-left: 5px;
          content: "\f105";
          font-family: 'Font Awesome\ 5 Free';
          font-weight: 900;
        }
      }
    }
  }
}


@include media-breakpoint-up(md) {
  .menu-toggle[aria-controls="top-menu"] {
      display: none;
  }
}

@include media-breakpoint-down(md) {
  .menu-toggle[aria-controls="top-menu"] {
    border: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
    outline: none;
    border-radius: 3px;
    display: flex;
    position: absolute;
    padding: 10px;
    right: 25px;
    top: 25px;
    width: $menubuttonsize;
    height: $menubuttonsize;
    text-indent: -9999%;
    background: rgba($primary, 1);
    border: none;
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
    -webkit-transition: .5s ease-in-out;
    -moz-transition: .5s ease-in-out;
    -o-transition: .5s ease-in-out;
    transition: .5s ease-in-out;
    cursor: pointer;

    div {
      position: relative;
      width: 100%;
      height: 100%;
    }

    &:focus {
      border: none;
      outline: 0;
    }

    span, i, b {
      display: block;
      position: absolute;
      height: 5px;
      width: 100%;
      background: $menufontcolor;
      border-radius: $btn-border-radius;
      opacity: 1;
      left: 0;
      -webkit-transform: rotate(0deg);
      -moz-transform: rotate(0deg);
      -o-transform: rotate(0deg);
      transform: rotate(0deg);
      -webkit-transition: .25s ease-in-out;
      -moz-transition: .25s ease-in-out;
      -o-transition: .25s ease-in-out;
      transition: .25s ease-in-out;
    }

    .icon-bars, .icon-close {
      width: 32px;
      height: 32px;
      fill: $white;
    }

    &[aria-expanded="true"] {
      background: $secondary;

      .icon-bars {
        display: none;
      }

      .icon-close {
        display: block;
      }
    }

    &[aria-expanded="false"] {
      background: $primary;

      .icon-bars {
        display: block;
      }

      .icon-close {
        display: none;
      }
    }
  }
  #site-navigation {
    position: relative;

    &::before, &::after {
      content: "";
      display: table;
      clear: both;
    }
  }
}